from dataclasses import dataclass


@dataclass
class DbConfig(object):
    TYPE = ""
    CONNECTOR = ""
    URL = ""
    PORT = None
    USERNAME = ""
    PASSWORD = ""
    DRIVER = ""
    DATABASE_NAME = ""

    def get_url(self):
        return f"{self.TYPE}+{self.CONNECTOR}://{self.USERNAME}:{self.PASSWORD}@{self.URL}:{self.PORT}/{self.DATABASE_NAME}"


@dataclass
class MysqlConfig(DbConfig):
    TYPE = "mysql"
    CONNECTOR = "jdbc"
    DRIVER = "com.mysql.cj.jdbc.Driver"

